<?php

use Phalcon\Mvc\Controller;

class ErrorsController extends Controller {

    public function show404Action() {
        //允许跨域访问
        $this->response->setHeader("Access-Control-Allow-Credentials", "true");
        $this->response->setHeader("Access-Control-Allow-Origin", "http://localhost:8080");
        $this->response->setStatusCode(404, "Not found!");
    }

    public function show500Action() {
        //允许跨域访问
        $this->response->setHeader("Access-Control-Allow-Credentials", "true");
        $this->response->setHeader("Access-Control-Allow-Origin", "http://localhost:8080");
        $this->response->setStatusCode(500, "System errors!");
    }

    public function show403Action() {
        //允许跨域访问
        $this->response->setHeader("Access-Control-Allow-Credentials", "true");
        $this->response->setHeader("Access-Control-Allow-Origin", "http://localhost:8080");
        $this->response->setStatusCode(403, "No right to access!");
    }
}
